package com.caowei.weicimpress.weicimpress;

import android.support.annotation.NonNull;

import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Created by caoweiPc on 2014/7/18.
 */
interface FileHandler extends Serializable{
    public int compare(FileHandler fileHandler);
    public boolean isThisHandler(File rootFile);
    //不分卷
    public File compress(File saveName,String passwd,int compressmethod_key,List<FileInfoBean> beans);
    public MainPartFile compress(File saveName,
                            String passwd,
                            int compressmethod_key,
                            List<FileInfoBean> beans,
                            int subsize,
                            String unit);
    public File extractAll(File targetDir,FileInfoBean bean);
    public File extractItem(File targetDir,FileInfoBean bean);
    public MyDataList list(FileInfoBean fileInfoBean);
    public String getNameOfFormat() ;
    public void setNameOfFormat(@NonNull String nameOfFormat);
    public Map<Integer, String> getDeflate_method() ;
    public boolean isEncried(File file);
    public abstract boolean isSurpportCryptogram();
    public abstract List<File> getCompressingFiles();
    public abstract boolean checkCompressNoFinished(File file);
    public boolean isSplite(File rootFile);
    public enum OperType{
        COMPRESS,
        EXTRACT,
        LIST
    }
    public boolean delete(List<FileInfoBean> beans,char[] passwd);

    public void batchRenamePartsByMainFile(MainPartFile mainPartFile);

    public static class MainPartFile{
        public List<String> getPartFiles() {
            return partFiles;
        }

        public void setPartFiles(List<String> partFiles) {
            this.partFiles = partFiles;
        }

        List<String> partFiles=new ArrayList<String>();

        public File getMainFile() {
            return mainFile;
        }

        public void setMainFile(File mainFile) {
            this.mainFile = mainFile;
        }

        File mainFile;
    }
}
